$(document).ready(function() {
	$("#page").myPagination({
		currPage : $('#currentPage').val(),
		pageCount : 1,
		pageSize : 10,
		ajax : {
			on : true,
			callback : 'change',
			url : appPath + "/dealer/pageteamdetail.htm?token=" + $.cookie('token') + "&type=" + $("#type").val(),
			dataType : 'html'
		}
	});
	
	$("input[type='radio']").bind("click", function(){
		var checked = $(this).prop("checked");
		if(checked){
			$('#currentPage').val(1);
			$("#page").myPagination({
				currPage : $('#currentPage').val(),
				pageCount : 10,
				pageSize : 10,
				ajax : {
					on : true,
					callback : 'change',
					url : appPath + "/dealer/pageteamdetail.htm?token=" + $.cookie('token') + "&type=" + $("#type").val(),
					dataType : 'html'
				}
			});
		}
	});
	
});

function change(data) {
	if(data.indexOf("loginpage") > -1){
		location.href = appPath + "/member/login.htm";
	}
	$('#list').html(data);
	if($('#pageCount').val()==1||($('#pageCount').val()==0)){
		$('#page').html("");
		$('#page').hide();
	} else {
		$('#page').show();
	}
}

function seller(id, type){
	window.open('/buyer/seller.htm?id=' + id + "&page=team" + type + "&token=" + $.cookie('token'));
}